//
//  TPAlertViewController.h
//  CloudAtCostPanel
//
//  Created by leonardo on 2017/2/9.
//  Copyright © 2017年 tanpengsccd. All rights reserved.
//


#import "TPUIKit.h"






#pragma mark - ------------------------TPAlertViewController-------------------------
typedef NS_ENUM(NSUInteger , kAlertViewControllerType) {
    kAlertViewControllerType_Caution  = 1<< 0,/*> only for caution */
    kAlertViewControllerType_Function = 1<< 1, /*> for specical function module */
    kAlertViewControllerType_HUD      = 1<< 2, /*>  loadingHUD , square*/
    kAlertViewControllerType_APN      = 1<< 3, /*>  APN */
};
@class TPAlertView;
@interface TPAlertViewController :NSObject
//@property(atomic , strong) NSMutableArray * alertViews;
@property(nonatomic , assign) kAlertViewControllerType alertViewControllerType;

+ (instancetype)defaultCautionViewController;

/**
 *  loading HUD ，只存在一个View
 *
 *  @return HUDViewController
 */
+ (instancetype)defaultHUDViewController;
//APN推送
//+ (instancetype)defautAPNViewController;

-(void)showAlertView:(TPAlertView *)alert animated:(BOOL)flag;
@end


#pragma mark - ------------------------TPAlertView-------------------------

typedef NS_ENUM(NSUInteger , kAlertViewType) {
//    ConstraintType_Caution,//左右margin 定长
//    ConstraintType_HUD,//mainView 正方形
    kAlertViewType_Caution  = 1<< 0, /*> only for caution ,fixed margin */
    kAlertViewType_Function = 1<< 1, /*> for specical function module,fixed margin */
    kAlertViewType_HUD      = 1<< 2, /*>  loadingHUD , square ,center*/
    kAlertViewType_APN      = 1<< 3, /*>  APN ,top */
};

typedef NS_ENUM(NSUInteger , TitleImageType) {
    TitleImageType_none = 0,
    TitleImageType_warning
};/**> alertview 顶部样式 无／感叹号 */



typedef void(^TPAlertViewTapBtnOkBlock)(id objec);/**> ok */
typedef void(^TPAlertViewTapBtnCancelBlock)(id objec);/**> cancel */



@interface TPAlertView : UIView
@property (nonatomic , strong) TPAlertViewController * parentVC;
@property (nonatomic , assign) NSUInteger showCount;
@property (nonatomic , assign) kAlertViewType alertViewType;

@property (nonatomic , strong) UIView * mainView;
@property (nonatomic , strong) MASConstraint * masLayoutConstraint_Main_show;
@property (nonatomic , strong) MASConstraint * masLayoutConstraint_Main_hide;
@property (nonatomic , strong) TPAlertViewTapBtnOkBlock      alertViewTapBtnOkBlock;
@property (nonatomic , strong) TPAlertViewTapBtnCancelBlock  alertViewTapBtnCancelBlock;




- (void)setAlertViewTapBtnOkBlock:(void(^)(id objec)) alertViewTapBtnOkBlock;
- (void)setAlertViewTapBtnCancelBlock:(void(^)(id objec))alertViewTapBtnCancelBlock;
- (void)dismissAnimated:(BOOL)flag;

+(instancetype)sharedHUDView_Loading;
/**
 *  【确定】 中部
 */
- (instancetype)initOkWithTitle:(NSString *)title subtitle:(NSString *) subtitle;
/**
 *  【确定|取消】 中部
 */
- (instancetype)initOkCancelWithTitle:(NSString *)title subtitle:(NSString *) subtitle;

/**
 *  textField
 */
- (instancetype)initTextFieldWithTitle:(NSString *)title subtitle:(NSString *)subtitle text:(NSString *)text placeholder:(NSString *)placeholder;
//- (instancetype)initHudWithType:(HUDType)HUDType;
@end
